เปลี่ยนไปสู่การรู้จำภาพด้วยคอมพิวเตอร์
วันนี้เราเปลี่ยนจากจัดการข้อมูลโครงสร้างง่าย ๆ โดยใช้เลเยอร์เชิงเส้นพื้นฐาน มาสู่การจัดการข้อมูลภาพมิติสูง ภาพสีเพียงภาพเดียวทำให้เกิดความซับซ้อนอย่างมาก ซึ่งสถาปัตยกรรมมาตรฐานไม่สามารถจัดการได้อย่างมีประสิทธิภาพ การเรียนรู้เชิงลึกสำหรับงานด้านภาพต้องใช้วิธีเฉพาะเจาะจง: เครือข่ายประสาทเทียมแบบคอนโวลูชัน (CNN)។
1. เหตุผลที่เครือข่ายที่เชื่อมโยงทุกจุด (FCN) ล้มเหลว
ในเครือข่ายที่เชื่อมโยงทุกจุด (FCN) ทุกพิกเซลของข้อมูลนำเข้าต้องเชื่อมต่อไปยังนิวรอนทุกตัวในเลเยอร์ถัดไป สำหรับภาพที่มีความละเอียดสูง ทำให้เกิดการระเบิดทางคำนวณ จนการฝึกอบรมกลายเป็นไปไม่ได้ และการทั่วไป (generalization) แย่ลงเนื่องจากเกิดการโอเวอร์ฟิตสูงมาก
- Input Dimension: A standard $224 \times 224$ RGB image results in $150,528$ input features ($224 \times 224 \times 3$).
- Hidden Layer Size: If the first hidden layer uses 1,024 neurons.
- Total Parameters (Layer 1): $\approx 154$ million weights ($150,528 \times 1024$) just for the first connection block, requiring massive memory and compute time.
แนวทางแก้ไขของ CNN
CNN แก้ปัญหาการขยายตัวของ FCN โดยใช้ประโยชน์จากโครงสร้างพื้นที่ของภาพ มันระบุรูปแบบ (เช่น ขอบหรือโค้ง) โดยใช้ฟิลเตอร์ขนาดเล็ก ลดจำนวนพารามิเตอร์ลงหลายเท่า และส่งเสริมความทนทาน
TERMINALbash — model-env
> Ready. Click "Run" to execute.
>
PARAMETER EFFICIENCY INSPECTOR Live
Run comparison to visualize parameter counts.
Question 1
What is the primary benefit of using Local Receptive Fields in CNNs?
Question 2
If a $3 \times 3$ filter is applied across an entire image, what core CNN concept is being utilized?
Question 3
Which CNN component is responsible for progressively reducing the spatial dimensions (width and height) of the feature maps?
Challenge: Identifying Key CNN Components
Relate CNN mechanisms to their functional benefits.
We need to build a vision model that is highly parameter efficient and can recognize an object even if it slightly shifts its position in the image.
Step 1
Which mechanism ensures the network can identify a feature (like a diagonal line) regardless of where it is in the frame?
Solution:
Shared Weights. By using the same filter across all locations, the network learns translation invariance.
Shared Weights. By using the same filter across all locations, the network learns translation invariance.
Step 2
What architectural choice allows a CNN to detect features with fewer parameters than an FCN?
Solution:
Local Receptive Fields (or Sparse Connectivity). Instead of connecting to every pixel, each neuron only connects to a small, localized region of the input.
Local Receptive Fields (or Sparse Connectivity). Instead of connecting to every pixel, each neuron only connects to a small, localized region of the input.
Step 3
How does the CNN structure lead to hierarchical feature learning (e.g., edges $\to$ corners $\to$ objects)?
Solution:
Stacked Layers. Early layers learn simple features (edges) using convolution. Deeper layers combine the outputs of earlier layers to form complex, abstract features (objects).
Stacked Layers. Early layers learn simple features (edges) using convolution. Deeper layers combine the outputs of earlier layers to form complex, abstract features (objects).